home *** CD-ROM | disk | FTP | other *** search
-
-
-
- sssseeeemmmm____wwwwaaaaiiiitttt((((3333CCCC)))) sssseeeemmmm____wwwwaaaaiiiitttt((((3333CCCC))))
-
-
-
- NNNNAAAAMMMMEEEE
- _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt, _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt - acquire a posix named or unnamed semaphore
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_eeee_mmmm_aaaa_pppp_hhhh_oooo_rrrr_eeee_...._hhhh_>>>>
- _iiii_nnnn_tttt _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt_((((_ssss_eeee_mmmm______tttt _****_s_e_m_))))_;;;;
- _iiii_nnnn_tttt _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt_((((_ssss_eeee_mmmm______tttt _****_s_e_m_))))_;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt atomically decrements the value of the semaphore located at
- address _s_e_m. If the semaphore's value is less than zero after the
- decrement, the calling process blocks on the semaphore. Otherwise, the
- calling process continues without blocking.
-
- A process blocked on a semaphore remains blocked until either another
- process posts the semaphore via _ssss_eeee_mmmm______pppp_oooo_ssss_tttt, or the _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt operation is
- interrupted by a signal.
-
- _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt atomically decrements the semaphore _oooo_nnnn_llll_yyyy if the resulting
- value is greater than or equal to zero. This way, the _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt
- function will never cause the calling process to block on the semaphore.
-
- The address _s_e_m may reside anywhere in the calling processes address
- space, but the process must have read and write access to _s_e_m.
-
- _ssss_eeee_mmmm______wwww_aaaa_iiii_tttt or _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt will fail if one or more of the following are
- true:
-
- [EAGAIN] _ssss_eeee_mmmm______tttt_rrrr_yyyy_wwww_aaaa_iiii_tttt will generate this error if the semaphore was not
- available.
-
- [EDEADLK] A deadlock condition was detected.
-
- [EINVAL] The semaphore located at address _s_e_m is not a valid posix
- named or unnamed semaphore.
-
- [EINTR] The operation was interrupted by a signal.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- sem_init(3C), sem_destroy(3C), sem_getvalue(3C), sem_post(3C),
- sem_wait(3C), sem_trywait(3C), sem_open(3C), sem_close(3C),
- sem_unlink(3C),
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Upon successful completion, a value of 0 is returned to the calling
- process. Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to
- indicate the error.
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-